<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateManagersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('managers', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('username',50)->comment('用户名')->default('')->unique();
            $table->string('password',255)->comment('密码')->default('');
            //$table->unsignedTinyInteger('groupid')->comment('会员组ID');
            $table->string('name',50)->comment('真实姓名')->default('');
            $table->string('email',100)->comment('邮箱号码')->default('');
            $table->unsignedTinyInteger('is_admin')->comment('是否管理员')->default(0);
            $table->string('role')->comment('权限列表')->default('');
            $table->string('avatar')->comment('头像')->default('');
            $table->string('lastip')->comment('上一次登录ip')->default('');
            $table->timestamp('lasttime')->comment('最后登录时间')->nullable()->default(null);
            $table->rememberToken();//记住我
            $table->timestamps();//时间戳

            $table->comment = '管理员表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('managers');
    }
}
